package com.hongye.backstage.service.impl;

import com.hongye.backstage.dao.HongyeHouseDao;
import com.hongye.backstage.entity.HomeyHouseDetailsEntity;
import com.hongye.backstage.entity.HongyeHouseEntity;
import com.hongye.backstage.service.HongyeHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @progam:hongye-house
 * @author:GJS
 * @Time:2022/4/20 18:39
 */
@Service
public class HongyeHouseServiceImpl implements HongyeHouseService {

    @SuppressWarnings("all")
    @Autowired
    private HongyeHouseDao hongyeHouseDao;

    @Override
    public void addHouse(List<HongyeHouseEntity> list) {
        for (HongyeHouseEntity HongyeHouseEntity : list) {
            HongyeHouseEntity.setUpdateTime(new Date());
        }
        hongyeHouseDao.addHouse(list);
    }

    @Override
    public List<HongyeHouseEntity> findHouseList() {
        return hongyeHouseDao.findHouseList();
    }

    @Override
    public int updateHouseList(HongyeHouseEntity hongyeHouseEntity) {
        return hongyeHouseDao.updateHouseList(hongyeHouseEntity);
    }

    @Override
    public int delectHouseList(Integer hid) {
        return hongyeHouseDao.delectHouseList(hid);
    }

    @Override
    public int updateHouseUid(Integer hid, Integer uid) {
        return hongyeHouseDao.updateHouseUid(hid,uid);
    }

    @Override
    public List<HomeyHouseDetailsEntity> findHouse() {
        return hongyeHouseDao.findHouse();
    }
}
